package daoIpmt;

import java.sql.SQLException;
import java.util.List;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import beans.Success;
import dao.SuccessDao;
import utils.DataSourceUtils;

public class SuccessDaoIpmt implements SuccessDao{

	private  DataSource ds=DataSourceUtils.getDataSource();
	private QueryRunner qr=new QueryRunner(ds);
	public List<Success> findAllSuccesss() {
		String sql = "select * from success";
		try {
			List<Success> list = qr.query(sql, new BeanListHandler<Success>(Success.class));
			return list;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

}
